package com.bestbuy.pojo;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;


/**
 * @author ThanhNgo
 * 
 */
@Entity
@Table(name = "catalog")
public class Catalog {
	@Id
	@Column(name = "IDCATALOG")
	//@GeneratedValue
	private Integer idCatalog;

	@Column(name = "CATALOGCODE")
	private String catalogCode;

	@Column(name = "CATALOGNAME")
	private String catalogName;

	@Column(name = "ISDELETED")
	private Integer isDeleted;
	
	
	@OneToMany(mappedBy="catalog", fetch = FetchType.LAZY,cascade = CascadeType.ALL)
	private Set<Product> products = new HashSet<Product>(0);

	public Integer getIdCatalog() {
		return idCatalog;
	}

	public void setIdCatalog(Integer idCatalog) {
		this.idCatalog = idCatalog;
	}

	public String getCatalogCode() {
		return catalogCode;
	}

	public void setCatalogCode(String catalogCode) {
		this.catalogCode = catalogCode;
	}

	public String getCatalogName() {
		return catalogName;
	}

	public void setCatalogName(String catalogName) {
		this.catalogName = catalogName;
	}

	public Integer getIsDeleted() {
		return isDeleted;
	}

	public void setIsDeleted(Integer isDeleted) {
		this.isDeleted = isDeleted;
	}

	public Set<Product> getProducts() {
		return products;
	}

	public void setProducts(Set<Product> products) {
		this.products = products;
	}

	public Catalog(Integer idCatalog, String catalogCode, String catalogName,
			Integer isDeleted, Set<Product> products) {
		super();
		this.idCatalog = idCatalog;
		this.catalogCode = catalogCode;
		this.catalogName = catalogName;
		this.isDeleted = isDeleted;
		this.products = products;
	}

	public Catalog() {
//		super();
		// TODO Auto-generated constructor stub
	}
	
	
}
